<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	</head>
	<style type="text/css">
		a {
			color: #FFFFFF;
		}
	</style>
	<body>
		<header class="mui-bar mui-bar-nav header">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">朋友圈</h1>
		</header>
		<!--下拉刷新容器-->
		<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
			<div class="mui-scroll">
				<!--数据列表-->
				<div id="slider" class="mui-slider">
					<div class="mui-slider-group mui-slider-loop">
						<!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
						<div class="mui-slider-item mui-slider-item-duplicate">
							<a href="#">
								<img src="http:\/\/placehold.it\/400x300">
							</a>
						</div>
						<!-- 第一张 -->
						<div class="mui-slider-item">
							<a href="#">
								<img src="http:\/\/placehold.it\/400x300">
							</a>
						</div>
						<!-- 第二张 -->
						<div class="mui-slider-item">
							<a href="#">
								<img src="http:\">
							</a>
						</div>
						<!-- 第三张 -->
						<div class="mui-slider-item">
							<a href="#">
								<img src="http:\">
							</a>
						</div>
						<!-- 第四张 -->
						<div class="mui-slider-item">
							<a href="#">
								<img src="http:\/\/placehold.it\/400x300">
							</a>
						</div>
						<!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
						<div class="mui-slider-item mui-slider-item-duplicate">
							<a href="#">
								<img src="http:\/\/placehold.it\/400x300">
							</a>
						</div>
					</div>
					<div class="mui-slider-indicator">
						<div class="mui-indicator mui-active"></div>
						<div class="mui-indicator"></div>
						<div class="mui-indicator"></div>
						<div class="mui-indicator"></div>
					</div>
				</div>
				<ul class="mui-table-view">
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/jd.png">
							<div class="mui-media-body">
								京东购物
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media">
						<a href="javascript:;">
							<img class="mui-media-object mui-pull-left" src="img/game.png">
							<div class="mui-media-body">
								游戏
							</div>
							<span class="mui-navigate-right"></span>
						</a>
					</li>
				</ul>
			</div>
		</div>
		<script src="js/mui.js"></script>
		<script type="text/javascript">
			function pull() {
				setTimeout(function() {
					var lis = document.createElement('li')
						lis.className = 'mui-table-view-cell mui-media'
						lis.innerHTML = `<a href="javascript:;">
										<img class="mui-media-object mui-pull-left" src="img/game.png">
										<div class="mui-media-body">
											下拉测试测试
										</div>
										<span class="mui-navigate-right"></span>
									</a>`
								mui('.mui-table-view')[0].insertBefore(lis,mui('.mui-table-view')[0].firstChild)
								mui('#refreshContainer').pullRefresh().endPulldownToRefresh()
					
				},1500)
			}
			function up() {
				setTimeout(function() {
					var lis = document.createElement('li')
						lis.className = 'mui-table-view-cell mui-media'
						lis.innerHTML = `<a href="javascript:;">
										<img class="mui-media-object mui-pull-left" src="img/game.png">
										<div class="mui-media-body">
											上拉测试测试
										</div>
										<span class="mui-navigate-right"></span>
									</a>`
								mui('.mui-table-view')[0].appendChild(lis)
								mui('#refreshContainer').pullRefresh().endPullupToRefresh()
					
				},1500)
			}
			mui.init({
			  pullRefresh : {
			    container:"#refreshContainer",//下拉刷新容器标识，querySelector能定位的css选择器均可，比如：id、.class等
			    down : {
			      height:50,//可选,默认50.触发下拉刷新拖动距离,
			      contentdown : "下拉可以刷新",//可选，在下拉可刷新状态时，下拉刷新控件上显示的标题内容
			      contentover : "释放立即刷新",//可选，在释放可刷新状态时，下拉刷新控件上显示的标题内容
			      contentrefresh : "正在刷新...",//可选，正在刷新状态时，下拉刷新控件上显示的标题内容
			      callback :pull //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
			    },
				up:{
					height:50,//可选,默认50.触发下拉刷新拖动距离,
					contentdown : "上拉可以加载",//可选，在下拉可刷新状态时，下拉刷新控件上显示的标题内容
					contentover : "释放立即加载",//可选，在释放可刷新状态时，下拉刷新控件上显示的标题内容
					contentrefresh : "正在加载...",//可选，正在刷新状态时，下拉刷新控件上显示的标题内容
					callback :up //必选，刷新函数，根据具体业务来编写，比如通过ajax从服务器获取新数据；
				}
			  }
			});
		</script>
	</body>

</html>
